﻿/********************************************************************************************************************
* Author:	Christos Polydorou																						*
* Email:	std04237@di.uoa.gr																						*
* Purpose:	This script is used in order to create the "Category-Moderator" table that connects each category with	*
*			it's moderators.																						*
********************************************************************************************************************/

CREATE TABLE [dbo].[Category-Moderator]
(
	Category bigint NOT NULL,												/* The id of the category */
	Moderator bigint NOT NULL,												/* The id of the moderator */
	FOREIGN KEY (Category) REFERENCES Categories(ID),
	FOREIGN KEY (Moderator) REFERENCES Users(ID),
	CONSTRAINT UniquePair UNIQUE (Category,Moderator)
)
